import { Context } from '../../../src/common';
import * as t from 'assert';
import { parseSource } from '../../../src/parser';

describe('Miscellaneous - Failure', () => {
  for (const arg of [
    'async function f(await) {}',
    'async await => {}',
    'eval => {"use strict";}',
    '(eval) => {"use strict";}',
    '(foo, eval) => {"use strict";}',
    '(package) => {"use strict";}',
    'a: let {}',
    'a = let {}',
    `a = let
    []`,
    '(break) => {"use strict";}',
    '(break) => {}',
    ` for await (a of b) let
    [] = y`,
    'for (a of b) let [x] = y',
    '({1: ({}) += (1)});',
    '({1: ({}) = (1)});',
    'x/{c:/ /=>',
    '+{f(){}==',
    '0xabcinstanceof x',
    'let foo = async (a = function() { }) => { "use strict"; a(); }',
    '3in x',
    '01234567in y',
    '02in y',
    '08in y',
    '0B0in y',
    '0O034in y',
    '0Xin y',
    '0Xain y',
    '0bin y',
    '0oin y',
    '0o465in y',
    '0xFin y',
    '134in y',
    '.24-e7in y',
    '.24ein y',
    '0Binstanceof x',
    '0O034instanceof x',
    '0o465instanceof x',
    '3instanceof x',
    '.24einstanceof x',
    '{0O}',
    '23.e in x',
    'with (a) let [x] = y',
    'async let [] = y',
    'for (a in b) let x',
    'with (a) let [x] = y',
    'with (a) let [] = y',
    'async let []',
    'async let [] = y',
    'async let {}',
    '{ let [] }',
    '() => { let {} }',
    'switch (a) { case b: let [x] }',
    'switch (a) { case b: let {} }',
    'switch (a) { case b: let {x} }',
    `do let [x]
    while (a);`,
    `do let [x] = y
    while (a);`,
    `do let {}
    while (a);`,
    `do let {} = y
    while (a);`,
    `do let {x}
    while (a);`,
    'do let [] = y while (a);',
    'do let [x] while (a);',
    'do let {} while (a);',
    'do let {x} = y while (a);',
    'do let [] = y; while (a);',
    'do let {}; while (a)',
    '() => let x',
    'var\\u1680x;',
    'var\\u180ex;',
    'var\\u2000x;',
    '(async)(a) => {}',
    'let async function() { } = { };',
    'if ( true, ) {}',
    'async (package) => {"use strict";}',
    'async (break) => {"use strict";}',
    'async (break) => {}',
    'for (let a = b in c; ;);',
    '[ ] [ [ ] >[ ]< [ ] ] [ ]',
    '(foo, break) => {}',
    'function a(){ "use strict"; function a(a=yield){}}',
    'class A {set a(yield){}}',
    '();',
    '[(a = 1)] = t;',
    '[([b])] = t;',
    '[([a])] = 12;',
    '(a, ...b);',
    'var e = [a -= 12] = 5',
    'function l() { "\\12"; "use strict" }',
    'function l() { "\\00002"; "use strict" }',
    'function l() { "\\712"; "use strict" }',
    'function l() { "\\12"; "use strict" }',
    '[ a -= 12 ] = 12;',
    '(...a)',
    '(a, ...b)',
    '(((...a)))',
    '0++',
    '0--',
    'let let;',
    '({a: 0} = 0);',
    '({get a(){}} = 0)',
    '({a}) = 0;',
    '({a: 0} = 0);',
    '({a} += 0);',
    '[...{a: 0}] = 0;',
    '({a: 0} = 0);',
    'for({a: 0} of 0);',
    '\\u0000',
    'for(const let = 0;;);',
    '{ const a; }',
    'function f(){ const a; }',
    `for (let a of (function*() {
      for (var b of (function*() {
              for (var c of (function*() {
                      for (var d of (function*() {
                              for (var e of (function*() {
                                      for (var f of (function*() {
                                              for (var g of (x = (yield * 2)) => (1)) {
                                              }
                                      })()) {
                                      }
                              })()) {
                              }
                      })()) {
                      }
              })()) {
              }
      })()) {
      }
    })()) {
    }`,
    'for(const a = 0;;) label: function f(){}',
    'for(;;) labelA: labelB: labelC: function f(){}',
    'for(;;) labelA: labelB: labelC: function f(){}',
    'for(let let in 0);',
    'continue;',
    'label: continue label;',
    'class A { f(eval){} };',
    'class A { *f(eval){} }',
    'function f(a){ super.b }',
    'for(let let;;);',
    '(a,);',
    '(((a, ...b)))',
    '({ a = 0 });',
    'class A extends B { constructor() { !{constructor() { super(); }}; } }',
    'class A extends B { constructor() { !{get constructor() { super(); }}; } }',
    'async eval => {"use strict";}',
    'async (eval) => {"use strict";}',
    'arguments => {"use strict";}',
    'async arguments => {"use strict";}',
    'function f(x=(yield z)=y){}',
    // '`a${await foo}d`',
    `for (a+b in c) d;`,
    `for (a+b of c) d;`,
    'for ({x = y} ;;) {}',
    'for ({x = y} ;1 ;) {}',
    'for ({x = y} ;1 ;1) {}',
    `for ({a=b};;);`,
    `({*[expr](){}} = x)`,
    '({*[expr](){}}) = x',
    '({a: {a=b}.x}) => x',
    'class K extends {} {;async\\n async *1(){}}',
    `for (a,b of c) d;`,
    `for (a, b of c);`,
    `for (a,b of c) d;`,
    '"use strict"; (1, eval)++',
    '"use strict"; ++(1, 2, 3, eval)',
    '"use strict"; (1, eval)--',
    '(y, x)++',
    '(true ? x : y)++',
    '++++x',
    '{ { }',
    'a: b: c: new f(x++)++',
    'function f() { (1--).x }',
    '(a:) --b',
    'function f() { ++ -- ++ a }',
    'function f() { ++ new new a ++ }',
    '"use strict"; (package) => {}',
    '"use strict"; async (package) => {}',
    'async (package) => { "use strict"; }',
    `do x
    while ({ [y = [yy]]: { x = (y)} ? null : false  })`,
    '"use strict"; for (let in x);',
    `function* f(){ yield↵/foo }`,
    `wrap({get 123: x});`,
    'for (let {x}.y of x);',
    'for (let {x}.y in x);',
    'for (let[a+b] in x);',
    'for (let() in x);',
    `function *g() { async yield => {}; }`,
    `function *g() { async yield = {}; }`,
    'function f(eval) { "use strict"; }',
    'function f(a, eval) { "use strict"; }',
    'let [o.x=1]=[]',
    'var [((((a)))), b] = [];',
    ' var [(a)] = 0',
    'const [(x)] = []',
    'let [(x().foo)] = x',
    'let [(x) = y] = [];',
    'let [(x)] = [];',
    '[new ++([])',
    'this.foo[foo].bar(this)(bar)[foo]()--',
    '((x,x)) = 5',
    '(((x,x))) = 5',
    'async ({a = b})',
    'new Date++;',
    'for(let.a of 0);',
    '({...{b = 0}.x} = {});',
    '[[(x, y)]] = x;',
    '[...[(x, y)]] = x;',
    '({a: {b = 0}.x} = {});',
    '[[(x, y)]] = x;',
    '[...[(x, y)]] = x;',
    '(async function*() { } = 1);',
    '([(x().foo)]) => x',
    '({a: {b = 0}.x} = {});',
    '[...{a = 0}.x] = [];',
    '[...(a,b)] = [],',
    '[...{ a }] = b,',
    'for (+i in {});',
    'for({} = 0 of {});',
    'for({p: x} = 0 of {});',
    'for({p: x = 0} = 0 of {});',
    'for({x} = 0 of {});',
    'for({x = 0} = 0 of {});',
    'async function f() { for await ({0: a = 1} = 1 of []) ; }',
    'async function * f() { for await({a: a = 1} = 1 of []){ } }',
    'async function * f() { for await({a} = 1 of []){ } }',
    'async function f() { for await ([a] = 1 of []) ; }',
    'async function f() { for await ({[Symbol.iterator]: a = 1} = 1 of []) ; }',
    'for ((a?b:c) in y)z;',
    'for ((a,b) in c);',
    'for (((a,b)) in c);',
    'for ({}.x);',
    'for ([...[a]] = 0 in {});',
    'true:oops;',
    'for(let.a of 0);',
    '(a, arguments) => { "use strict"; }',
    'function f(a, arguments) { "use strict"; }',
    `for (const x;;);`,
    `for (let of x) y`,
    `"use strict"; for (let.x in y);`,
    `"use strict"; for (let() of y);`,
    `for (let() of y);`,
    `for (let[x];;);`,
    `for (let of y);`,
    `for (let().foo of x);`,
    `for (let() in x);`,
    `for (let.foo of x);`,
    `for (let() of x);`,
    `for(let.a of 0);`,
    `for (let.a of x);`,
    `function *f(){ for (yield of obj); }`,
    `for (let.x of y);`,
    `for (let() of y);`,
    `for (let + of y);`,
    `for (let + in y);`,
    `for (let() in y);`,
    `"use strict"; for (let + of y);`,
    // `async ({x} = await bar);`,
    `async ({} + 1) => x;`,
    `({x: y}.length) => x;`,
    `({x = y}.z) => obj`,
    `({a: {x = y}}.z) => obj`,
    'for (var i = 20 of b) { }',
    'for (var {i} = 20 of b) { }',
    'for (var [i] = 20 of b) { }',
    'for (let [i] = 20 of b) { }',
    'for (const [i] = 20 of b) { }',
    'for (const i = 20 of b) { }',
    'for (let i = 20 of b) { }',
    'for (let i = 20 in b) { }',
    'for (const i = 20 in b) { }',
    'for (const {i} = 20 in b) { }',
    'for (let {i} = 20 in b) { }',
    'for (a, b in c) break',
    'for (const let = 10; ; ) { break; }',
    'for (const let in {}) { break; }',
    'for (const let of []) { break; }',
    'for (let let = 10; ; ) { break; }',
    'for (let let in {}) { break; }',
    'for (let let of []) { break; }',
    'for ( %a ; ; ) { }',
    'for () { }',
    'for ( a ) { }',
    'for ( ; ) ;',
    'for a ; b ; c { }',
    'for (a ; { }',
    'for ( a ; ) ;',
    'for ( ; a ) break',
    'var',
    'var = 7',
    'var c (6)',
    'if (a) var a,b; else { const b, c }',
    'var 5 = 6',
    'var a = if (b) { c }',
    'var a = var b',
    'const a = b += c, a, a, a = (b - f())',
    'var a %= b | 5',
    'var (a) = 5',
    'var a = (4, b = 6',
    'const "l" = 3',
    'var var = 3',
    'const a, a, a = void 7 - typeof 8, a = 8',
    'var a = ?',
    'const a = *7',
    'var a = :)',
    'var a = b ? c, b',
    'const a = b : c',
    `({x} = await bar) => {}`,
    `async ({x} = await bar) => {}`,
    `let z = async ({x} = await bar) => {}`,
    // `async ({x} = await bar);`,
    'function foo(a, ...b, c) { }',
    'function foo(a, ...b, ) { }',
    'function foo(a, ...[b], ) { }',
    'function foo(a, ...{b}, ) { }',
    'function foo(...a, ...b) { }',
    'function foo(a, ...{b} = 20) { }',
    'function foo(a, ...b = 20) { }',
    'function * foo(o) { ({...{ x = yield }} = o); }',
    'var {...r = {a: 2}} = {a: 1, b: 2};',
    'var {...r, b} = {a: 1, b: 2};',
    'var {...r, ...e} = {a: 1, b: 2};',
    '({...new Object()} = {a: 1, b: 2});',
    '(function * (o) { ({ ...{ x: yield } } = o); })()',
    '(function () {"use strict"; ({...eval} = {}); })()',
    '(function () {"use strict"; ({...arguments} = {}); })()',
    'async function foo () { let {...await} = {}; }',
    'let {...let} = {a: 1, b: 2};',
    'const {...let} = {a: 1, b: 2};',
    'try { throw {a:2} } catch({...foo.a}) {}',
    '1 % -',
    '1 % typeof',
    '1 % void',
    '1 % !',
    '1 % ~',
    '1 % delete',
    '1 % ++',
    '1 % --',
    '1 % \n++',
    '1 % \n--',
    'var [...x = 20] = 20;',
    'var [...[...x = 20]] = 20;',
    'var {x}',
    'var {x, y}',
    'var {x} = 20, {x, y}',
    'var {foo:bar, bar:baz}',
    'var [x]',
    'var [x, y]',
    'var [x] = [], [x, y]',
    'for (of of of of){}',
    'for (of of; of; of){}',
    'for (of of []; of; of){}',
    'for (of of){}',
    'for (var of of){}',
    'for (of of in of){}',
    'for (of in){}',
    'for (var of in){}',
    'for (var of.of of of){}',
    'for (var of[of] of of){}',
    'do function foo() { } while (false); ',
    'if (cond) label: function foo() { }',
    'while (true) { while (true) function bar() { } }',
    'with ({}) function bar() { }',
    'switch () {}',
    'case 5:',
    'default:',
    'switch (a) b;',
    'switch (a) case 3: b;',
    'function foo(...restParam) { "use strict"; }',
    'function foo(...restParam) { "a"; "use strict"; }',
    'function foo({x}) { "use strict"; }',
    'function foo({x}) { "a"; "use strict"; }',
    'function foo(a = 20) { "use strict"; }',
    'function foo(a = 20) { "a"; "use strict"; }',
    'function foo({a} = 20) { "use strict"; }',
    'function foo({a} = 20) { "a"; "use strict"; }',
    'function foo([a]) { "use strict"; }',
    'function foo([a]) { "a"; "use strict"; }',
    'function foo(foo, bar, a = 25) { "use strict"; }',
    'function foo(foo, bar, a = 25) { "a"; "use strict"; }',
    'function foo(foo, bar, baz, ...rest) { "use strict"; }',
    'function foo(foo, bar, baz, ...rest) { "a"; "use strict"; }',
    'let foo = (...restParam) => { "use strict"; }',
    'let foo = (...restParam) => { "a"; "use strict"; }',
    'let foo = ({x}) => { "use strict"; }',
    'let foo = ({x}) => { "a"; "use strict"; }',
    'let foo = (a = 20) => { "use strict"; }',
    'let foo = (a = 20) => { "a"; "use strict"; }',
    'let foo = ({a} = 20) => { "use strict"; }',
    'let foo = ({a} = 20) => { "a"; "use strict"; }',
    'let foo = ([a]) => { "use strict"; }',
    'let foo = ([a]) => { "a"; "use strict"; }',
    'let foo = (foo, bar, a = 25) => { "use strict"; }',
    'let foo = (foo, bar, a = 25) => { "a"; "use strict"; }',
    'let foo = (foo, bar, baz, ...rest) => { "use strict"; }',
    'let foo = (foo, bar, baz, ...rest) => { "a"; "use strict"; }',
    'let foo = (a = function() { }) => { "use strict"; a(); }',
    'let foo = (a = function() { }) => { "a"; "use strict"; a(); }',
    `async ({} + 1) => x;`,
    '({a=b}.x) => x',
    '({a=b}[x]) => x',
    '({a=b}(x)) => x',
    '([{a=b}].x) => x',
    '([{a=b}][x]) => x',
    '([{a=b}](x)) => x',
    'for (let() of y);',
    'var [(x)] = v;',
    'var {(x)} = v;',
    'const [(x)] = v;',
    'const {(x)} = v;',
    `(a,b,)`,
    'x = {x=y}',
    'for (let()() in y);',
    `(a = b,)`,
    `([x],)`,
    `({a},)`,
    `([x] = y,)`,
    `({a} = b,)`,
    `(a,) = x`,
    `(a,b,) = x`,
    `(a = b,) = x`,
    `([x],) = x`,
    `({a},) = x`,
    `([x] = y,) = x`,
    `({a} = b,) = x`,
    `(...x);`,
    `(a,b,)`,
    `([{a=b}.x]) => x`,
    `({a: {a=b}.x}) => x`,
    `[...[x].map(y, z)] = a;`,
    `({ident: {x}.join("")}) => x`,
    `({"x": [y].slice(0)} = x)`,
    `({"x": [y].slice(0)}) => x`,
    'let z = async ({x} = await bar) => {}',
    'async (x=(await)=y)=>z',
    'async function f(x=(await)=y){}',
    'async function f(x=(await z)=y){}',
    'async function f(){    (x=(await)=y)=>z   }',
    'async function f(){    (x=(await y)=y)=>z   }',
    'async function f(){    function g(x=(await z)=y){}   }',
    'async function f(){    async function g(x=(await)=y){}   }',
    'async function f(){    async function g(x=(await z)=y){}   }',
    '(x=(await z)=y)',
    '(x=(yield z)=y)',
    'function *f(x=(yield)=y){}',
    'function *f(x=(yield z)=y){}',
    `(a,)`,
    `(a = b,)`,
    '(a',
    'a[5',
    'a[5 + 6',
    'a.',
    '()',
    "a.'l'",
    'new -a',
    '(a:) --b',
    'a-- ++',
    '1: null',
    '+-!~',
    '+-!~((',
    'a)',
    'a]',
    '.l',
    '1.l',
    'a + * b',
    'a ? b',
    'a ? b :',
    '%a',
    'a in instanceof b.l',
    '- false = 3',
    'a + typeof b += c in d',
    'typeof a &= typeof b',
    'a(*a)',
    'a(.length)',
    'new a(5',
    '(function a{})',
    '(function this(){})',
    'function l++(){}',
    'let {a: b.c} = v;',
    'let {a.b} = v;',
    'let {a.b: c} = v;',
    'let {[a]} = v;',
    'let {[a]: b.c} = v;',
    '1 + {a',
    '(,f)',
    '{ a: }',
    'if (a) {} else x; else',
    'with a.b { }',
    'for ((a ? b : c) in c) break',
    'for a ; b ; c { }',
    'if (--a()) do with(1) try {} catch(ke) { f() ; g() } while (a in b) else {}',
    'for (var a = 5 += 6 in b) break',
    'for ((a, b) in c) break',
    'do g; while 4',
    'debugger X',
    'break 0.2',
    'if (a()) while(0) function f() {} else function g() {}',
    'if (a()) function f() { else function g() }',
    'if (a) if (b) ; else function f {}',
    'if (a) if (b) ; else function (){}',
    'var 5 = 6',
    'var a = if (b) { c }',
    'var a %= b | 5',
    'for ( ; a ) break',
    'for (a ; { }',
    'for () { }',
    'for ( ; var a ; ) break',
    'for (const a; ; ) break',
    'for ( %a ; ; ) { }',
    'for (var a = in b) break',
    'for (var a += 5 in b) break',
    'for (var a = (b in c in d) break',
    'for (var (a) in b) { }',
    'try a; catch(e) {}',
    'try {} catch (...) {}',
    'try {}',
    'catch(e) {}',
    'finally {}',
    'try a; catch(e) {}',
    'try {} catch(e) a()',
    'try {} finally a()',
    'try {} catch(e)',
    'try {} finally',
    'try {} finally {} catch(e) {}',
    'try {} catch (...) {}',
    'switch () {}',
    'case 5:',
    'default:',
    'switch (a) b;',
    'switch (a) case 3: b;',
    'switch (g) { case 1: a: }',
    'switch (g) { case 1: a: default: }',
    'switch g { case 1: l() }',
    'switch (g) { case 1:',
    'switch (4 - ) { }',
    'switch (l) { default case: 5; }',
    "for(var a,b 'this shouldn't be allowed' false ; ) ;",
    "for(var a,b '",
    'function a() { return 1, }',
    'test !== false ? success() :',
    'test !== false ? success()',
    'test !== false ?',
    '((a()',
    '(++)',
    '++()',
    'for (new new new a in b) break',
    'for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {}',
    'if (--a()) do with(1) try {} catch(ke) { f() ; g() } while (a in b) else {}',
    'if (0) new a(b+c) = 5',
    'const a = b += c, a, a, a = (b - f())',
    'const a = 5, b, c',
    's: l: a[2](4 == 6, 5 = 6)(f[4], 6)',
    'a: ((typeof (a))) >>>= a || b.l && c',
    '++a--',
    '++((a))--',
    '(a.x++)++',
    'a: b: c: new f(x++)++',
    '(1--).x',
    'function f() { a. }',
    'function f() { () }',
    "a.'l'",
    '++ -- ++ a',
    'function f() { ++ -- ++ a }',
    'function f() { ++a-- }',
    '1.l',
    'function f() { a(b.) }',
    'for (var a = 5 += 6 in b) break',
    'function f() { if (0) new a(b+c) = 5 }',
    'function f() { if (0) obj.foo\\su03bb;  }',
    'function f() { if (--a()) do with(1) try {} catch(ke) { f() ; g() } while (a in b) else {} }',
    'if (--a()) do with(1) try {} catch(ke) { f() ; g() } while (a in b) else {}',
    'function f() { for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {} }',
    'for (delete new a() in b) break',
    'for (a * a in b) break',
    'for ((a * a) in b) break',
    'for (a++ in b) break',
    'for ((a++) in b) break',
    'for (++a in b) break',
    'for ((++a) in b) break',
    'for (a, b in c) break',
    'for (var a = 5 += 6 in b) break',
    'for ((++a) in b) break',
    'for (a, b in c) break',
    'for (new a in b in c in d) break',
    'function f() { for (new a in b in c in d) break }',
    'for (new new new a in b) break',
    'function f() { for (new new new a in b) break }',
    'for (delete new a() in b) break',
    'for (var a = (b in c in d) break',
    'function f() { for (var a = (b in c in d) break }',
    'function f() { for (var (a) in b) { } }',
    'try {}',
    'function f() { try {} }',
    'catch(e) {}',
    'finally {}',
    'function f() { try {} catch(e) }',
    'try {} catch (...) {}',
    'if (--a()) do with(1) try {} catch(ke) { f() ; g() } while (a in b) else {}',
    'function f() { if (--a()) do with(1) try {} catch(ke) { f() ; g() } while (a in b) else {} }',
    'switch (true) { default: case 6: default: }',
    'switch (l) { case b ? c : }',
    'switch (4 - ) { }',
    'function f() { switch (4 - ) { } }',
    'switch (l) { default case: 5; }',
    "for(var a,b 'this shouldn't be allowed' false ; ) ;",
    'var a.b = c',
    'function f() { var a.b = c }',
    'function f() { var var = 3 }',
    'var a = (4, b = 6',
    'var a %= b | 5',
    'var a = if (b) { c }',
    'var',
    'continue a++',
    'if (a()) function f() { else function g() }',
    'function f() { if (a()) function f() { else function g() } }',
    'do if (a) while (false) else debugger',
    'while if (a) ;',
    'function f() { debugger X }',
    'function f() { break 0.2 }',
    'function f() { continue a++ }',
    '((...a = []) => {})',
    '(async (...a = []) => {})',
    '[]=>0',
    '(1, x)=0;',
    '"foo" | "bar" = ("foo");',
    '"foo" = (myRandBool ? "foo" : ("foo"));',
    '(...a, ...b) => {}',
    '(a, ...b,) => {}',
    'class E1 { 0123.1() {} }',
    'class E0 { 0123() {} }',
    'class E extends { }',
    'class E2 { static set prototype(x) {} }',
    'class A extends 0 ',
    'class A extends "test"',
    'class A extends {}',
    'class A extends undefined ',
    'for (({x}) of [{x:1}]) {}',
    '(o.f=1)=>0',
    '({...(obj)}) => {}',
    '({...(a,b)} = foo)',
    '({...})',
    '({...obj1,a} = foo)',
    'let {...[a,b]} = foo',
    'let {...(a,b)} = foo',
    '({...[a,b]}) => {}',
    'let {...obj1,} = foo',
    '({}) = 1',
    '({...obj1,...obj2} = foo)',
    '(async (...a, b) => {})',
    '(async (...a, ...b) => {})',
    '(async (...x = []) => {});',
    '(function((a)){})',
    '(function(...a = []) {})',
    '(async function(...a = []) {})',
    '(function(...a, ...b){})',
    '(async function(...a, b){})',
    '(async function(...a, ...b){})',
    'let { a: await b } = { a: 1 };',
    'let [await b] = [];',
    'var [ a, b, c ];',
    'for (var [ a ]; a; ) {}',
    'var { a, b, c };',
    'for (var { a, b, c }; a && b && c; ) {}',
    // 'let b = async () => []; for (a in await b());',
    'async ((a)) => {}',
    '({ async\nf(){} })',
    'for(let.a of 0);',
    'this.foo[foo].bar(this)(bar)[foo]()--',
    'for ({}.x);',
    'async (a, ...b, ...c) => {}',
    'function* a(){ async (yield) => {}; }',
    'async (a = await => {}) => {}',
    'async (a = aw\\u{61}it => {}) => {}',
    // 'async (a = (b = await (0)) => {}) => {}',
    '(a, ...b,) => 0',
    'function a(b, ...c,) {}',
    '({ a (,) {} })',
    '({ a (b,,) {} })',
    '({ a (b, ...c,) {} })',
    '(a,)',
    '({a:1},)',
    '((...a = []) => {})',
    '(async (...a = []) => {})',
    '[]=>0',
    '(a = 0, ...b = []) => {}',
    '({a = 0})',
    'let b = []; for await(a in b);',
    'for(const a = 0 in b);',
    'let b = []; for await(a in b);',
    'for await(;;);',
    '(...a, b) => {}',
    'continue (my_friend)',
    'do g; while ((4)',
    'do g; while 4',
    'function f() { with a.b { } }',
    'new -a',
    'function f() { new -a }',
    'a: b: c: new f(x++)++',
    'function f() { a-- ++ }',
    '(a:) --b',
    '++ -- ++ a',
    '(a++',
    'with a.b { }',
    'if (a) { else }',
    'if (a) {} else x; else',
    'delete the void',
    'function f() { (a++ }',
    '.l',
    'function f() { .l }',
    'with(true) let a',
    'for (; false; ) let {}',
    'for(let a of b, c);',
    'for(var a = 0 of b);',
    'a: let a',
    'a + * b',
    '1: null',
    'function f() { (a.x++)++ }',
    '(a.x++)++',
    'function f() { a + * b }',
    'a ? b :',
    'function f() { a- }',
    'a in instanceof b.l',
    'function f() { a in instanceof b.l }',
    'typeof a &= typeof b',
    'function f() { typeof a &= typeof b }',
    'function f() { a: ((typeof (a))) >>>= a || b.l && c }',
    'a(5,6',
    'new a(5',
    'function f() { function f(a b) {} }',
    'function f(a b) {}',
    '[,',
    'function f() { [, }',
    'function f() { 1 + {a }',
    '1 + {get l(',
    'function f() { 1 + {get l( }',
    'a ? b, c : d',
    '{ if (a) }',
    'if a {}',
    'if (a',
    'function f() { else {} }',
    `while 1 break;`,
    `while true break;`,
    `var x += 1;`,
    'foo--.toString();',
    'foo++.toString();',
    'while(true)break 5+5;',
    'while(true)continue 5+5;',
    '({ "x" = true } = y);',
    `\\`,
    `\\x`,
    `\\o`,
    `\\u1`,
    `\\u12`,
    `a\\uz`,
    `a\\o`,
    ',',
    ',,',
    ',,,',
    'ice,',
    'ice, fapper,,,',
    'function ("foo",") {}',
    ' function  a(b,,) {}',
    ' function* a(b,,) {}',
    '(function  a(b,,) {});',
    '(function* a(b,,) {});',
    '(function   (b,,) {});',
    '(function*  (b,,) {});',
    ' function  a(b,c,d,,) {}',
    ' function* a(b,c,d,,) {}',
    '(function  a(b,c,d,,) {});',
    '(function* a(b,c,d,,) {});',
    '(function   (b,c,d,,) {});',
    '(function*  (b,c,d,,) {});',
    '(b,,) => {};',
    '(b,c,d,,) => {};',
    'a(1,,);',
    'a(1,2,3,,);',
    ' function  a1(,) {}',
    ' function* a2(,) {}',
    '(function  a3(,) {});',
    '(function* a4(,) {});',
    '(function    (,) {});',
    '(function*   (,) {});',
    '(,) => {};',
    'a1(,);',
    ' function  a(...b,) {}',
    ' function* a(...b,) {}',
    '(function  a(...b,) {});',
    '(function* a(...b,) {});',
    '(function   (...b,) {});',
    '(function*  (...b,) {});',
    ' function  a(b, c, ...d,) {}',
    ' function* a(b, c, ...d,) {}',
    '(function  a(b, c, ...d,) {});',
    '(function* a(b, c, ...d,) {});',
    '(function   (b, c, ...d,) {});',
    '(function*  (b, c, ...d,) {});',
    'var {(a)} = 0',
    'var {a:(b)} = 0',
    '({(a)} = 0)',
    '({a:(b = 0)} = 1)',
    '(new.target) = 1',
    '([a += a] = a)',
    'for (`a` of b);',
    '(`a`) => b;',
    '({ x }) = { x: 5 };',
    'for(let x;let;)',
    'function*() { (yield\n/123/) }',
    'function*() { yield\n/123/ }',
    'function*() { yield /123/ }',
    'for(let x;let;)',
    'for await(let x)',
    'for(const x of bar)',
    'do while(2) x\nwhile(1) while(0)',
    'void {:,get x() {}}',
    'void {[] () {}}',
    '{break}',
    "'\n'",
    "'\r'",
    '"\r\n"',
    '"use strict";\n"\\76";',
    '"use strict";\nvar foo = "\\76";',
    '"use strict";\n"\\1";',
    '"use strict";\n"\\07";',
    '"use strict";\n"\\011"',
    '"use strict"; "\\08"',
    '"use strict"; "\\09"',
    // 'await ~123',
    'async () => class await {}',
    '{_ => {}/123/g;}',
    '({a}) = 1;',
    '(var {a:b} = {})',
    '({start, stop}) = othernode;',
    '{a, b} = {a: 1, b: 2}',
    '({a, b}) = {a: 1, b:2};',
    '({b}) = b;',
    '([b]) = b;',
    '({a}) = 2;',
    '([b]) = b;',
    '[(a = 0)] = 1',
    '([{constructor(){}}] = b);',
    '({ src: ([dest]) } = obj)',
    'let let = 1',
    'for (let let = 1; let < 1; let++) {}',
    'for (let let in {}) {}',
    'for (let let of []) {}',
    'const let = 1',
    '(a,...a)/*\n*/ => 0',
    '1 + ()',
    '() ? 0',
    '"use strict";(function(a, ...[foo]){"use strict"})',
    '"use strict";(function([], ...rest){"use strict"})',
    '"use strict";(function([], ...[foo]){"use strict"})',
    'for (const let = 1; let < 1; let++) {}',
    'for (const let in {}) {}',
    'for (const let of []) {}',
    'let [let] = 1',
    'for (let [let] = 1; let < 1; let++) {}',
    'for (let [let] in {}) {}',
    'for (let [let] of []) {}',
    'const [let] = 1',
    'for (const [let] = 1; let < 1; let++) {}',
    'for (const [let] in {}) {}',
    'for (const [let] of []) {}',
    'let l\\u0065t = 1',
    'const l\\u0065t = 1',
    'for (let l\\u0065t in {}) {}',
    'class A {foo(,) {}}',
    'class A {static foo(,) {}}',
    '(class {static foo(,) {}})',
    '({[1,2]:3})',
    '({ *a })',
    '({ *a: 0 })',
    '({ *[0]: 0 })',
    '(...b,) => {};',
    '(b, c, ...d,) => {};',
    '(,);',
    '(a,);',
    '(a,b,c,);',
    'n, op, val,',
    'foo(a,,) => 0',
    'async (a,,) => 0',
    'foo (,) => 0',
    ', => 0',
    ', () => 0',
    'async (,) => 0',
    'function foo(...a,) { }',
    '(function(...a,) { })',
    '(...a,) => a',
    'async (...a,) => a',
    '({foo(...a,) {}})',
    'class A {foo(...a,) {}}',
    'class A {static foo(...a,) {}}',
    '(class {foo(...a,) {}})',
    '(class {static foo(...a,) {}})',
    '(x, ...) => ...',
    `＊`,
    `\\uD800\\x62`,
    'function f() { (new.target)--; }',
    'function *a() { ({b = yield}) => {} }',
    '[a, ...(b = c)] = 0',
    '[(a = 0)] = 1',
    `"use strict"; label: function f(){}`,
    `"use strict"; if (0) function f(){}`,
    `"use strict";  if (0) function f(){} else;`,
    `"use strict"; if (0); else function f(){}`,
    `"use strict"; label foo: function f(){}`,
    `while(true) function a(){}`,
    `with(true) function a(){}`,
    'for (let a = 0 in {});',
    '"use strict"; for (var a = 0 in {});',
    'for (var {a} = 0 in {});',
    'for (a = 0 in {});',
    'for (var [a] = 0 in {});',
    'for (const a = 0 in {});',
    // Esprima issue>  https://github.com/jquery/esprima/issues/1719
    `if (false) L: async function l() {}`,
    '({ src: ([dest]) } = obj)',
    'function f([x] = [1]) { "use strict" }',
    '(async function*() { } = 1);',
    '(async function*() { } => 1);',
    'for(({a}) in 0);',
    'for(({a}) of 0);',
    'for(([a]) of 0);',
    'for(([a]) in 0);',
    '[a, ...(b = c)] = 0',
    '[v] += ary',
    'function *g(x = yield){}',
    'throw',
    'if(false)',
    'async ((x, y, z)) => 0 ',
    // 'const {params:{callFrames:[{callFrameId}]}} = await Protocol.Debugger.oncePaused();',
    '‿ = 10',
    'if(true) let a = 1;',
    '/*',
    '/**',
    '/*\n\n\n',
    '\n]',
    '//\r\n]',
    '//\n\r]',
    '//\r \n]',
    `function foo() {
      'use strict';
      function f() {
        var o = {};
        with (o) {};
      }
    }`,
    `function foo() {
      function f() {
        'use strict';
        var o = {};
        with (o) {};
      }
    }`,
    `function f() {
      'use strict';
      var o = {};
      with (o) {};`,
    `try{};catch{};finally{}`,
    `try{};finally{}`,
    `if{};else{}`,
    `if{};else if{}`,
    `if{};else if{};else{}`,
    `do{};while()`,
    `({a({e: a.b}){}})`,
    `(function *(x, ...yield){})`,
    `async function *isiah(){ await yield x}`,
    'function hello() { \'use strict\'; ({ "\\1": 42 }); }',
    "function hello() { 'use strict'; 021; }",
    'function hello() { \'use strict\'; "\\000"; }',
    'function hello() { \'use strict\'; "\\00"; }',
    'function hello() { \'use strict\'; "\\1"; }',
    "function hello() { 'use strict'; ({ 021: 42 }); }",
    'function hello() { "use strict"; function inner() { "octal directive\\1"; } }',
    'function hello() { "use strict"; var implements; }',
    'function hello() { "use strict"; var interface; }',
    'function hello() { "use strict"; var public; }',
    '(function a(eval) { "use strict"; })',
    '({ a:{} }) = 3;',
    "'use strict'; ({ async [yield]() {} });",
    'class X { async [yield]() {} }',
    "'use strict'; (async function yield() {});",
    'function* g() { async function yield() {} }',
    "'use strict'; async function yield() {}",
    'async function* f(a = await) {}',
    'let f = async function*(a = await) {}',
    'function f(a = async function*(a = await) {}) {}',
    'function f() { a = async function*(a = await) {}; }',
    'async function* f() { a = async function*(a = await) {}; }',
    'function f() { a = async function(a = await) {}; }',
    'async function f(a = await) {}',
    'let f = async function(a = await) {}',
    'function f(a = async function(a = await) {}) {}',
    'function f() { a = async function(a = await) {}; }',
    'async function f() { a = async function(a = await) {}; }',
    'async (a = await) => {}',
    'throw\n10;',
    'async function f() { async function await() {} }',
    "'use strict'; ({ async [yield]() {} });",
    'class X { async [yield]() {} }',
    'while (function* () {} += x);',
    "'use strict'; (async function yield() {});",
    'for ({} + b of obj);',
    'for (2 + b of obj);',
    'for ("abc" + b of obj);',
    'for (/x/g + b of obj);',
    'for (a + b of obj);',
    'for (/x/g + b in obj);',
    'for ("abc" + b in obj);',
    'for (2 + b in obj);',
    'for ({} + b in obj);',
    'for ([] + b in obj);',
    'for (a + b in obj);',
    'for (eval instanceof this; new 2e308;)',
    `([...x.y]) => z`,
    `([...x.y] = z) => z`,
    `for (a);`,
    '(((x)))\n++;',
    '(((x)))\n--;',
    `[...(x), y] = z`,
    'function* g() { async function yield() {} }',
    'async function k() { function a() { await 4; } }',
    'function* a() { await 4; }',
    'for (var [ v , c ] = 0 in undefined) { }',
    'var b = e; for (var [e] = b in w) c',
    'for (var {a: []} = 2 in []) { }',
    'for (var [x] = [] in null);',
    'for (var [x] = x in y) var x;',
    'for (var x = 3 in {}; ; ) break;',
    'for (var x, y = 3 in {}; ; ) break;',
    'for (var x = 5, y = 3 in {}; ; ) break;',
    'for (const x = 3 in {}; ; ) break;',
    'for (const x = 5, y = 3 in {}; ; ) break;',
    'for (let x = 3 in {}; ; ) break;',
    'for (let x, y = 3 in {}; ; ) break;',
    'for (let x = 2, y = 3 in {}; ; ) break;',
    `({async async: 0})`,
    `({async async})`,
    `({async async, })`,
    `({async async = 0} = {})`,
    'var this = 10;',
    `
    "use strict";
    function f() {
        var {yield} = {};
    }
`,
    `
    "use strict";
    function f() {
        var {yield = 0} = {};
    }
`,
    '[...a()] = []',
    '[...a=b] = []',
    '[a, ...b, c] = []',
    '[...a, ,] = []',
    '[...a++] = []',
    '[...(a,b)] = []',
    '[...!a] = []',
    '[...a+b] = []',
    'var [...a.x] = []',
    'var [...(b)] = []',
    '[...b,] = []',
    'switch (x) { something }',
    'function *f(){ return 5 + yield x; }',
    '(x=1)=2',
    `function *f(){ return function(x = yield y){}; }`,
    'yield (await foo)',
    'delete (foo)=>bar',
    `async function f(){ return await => {}; }`,
    'if (true) function* g() {  } else function* _g() {}',
    'if (true) function* g() {  } else ;',
    'if (true) function* g() {  }',
    'if (false) ; else function* g() {  }',
    'foo: function* g() {  }',
    // '`x${await x}y`',
    `async () \n => x`,
    `(async () \n => x)`,
    `1.a`,
    `1.e+`,
    `08a`,
    "'use strict'; `\\00`;",
    `0o1a`,
    `x \n isnt y`,
    `function default() {}`,
    `var default`,
    `for (let x = 42 in list) process(x);`,
    `for (let x = 42 of list) process(x);`,
    `'use strict'; let + 1`,
    `let let`,
    `'use strict'; let let`,
    `(([a, ...b = 0]) => {})`,
    `[a, ...b = 0] = []`,
    `[...a, b] = c`,
    `if (b,...a, );`,
    `switch (cond) { case 10: let a = 20; `,
    `obj = {x = 0}`,
    `f({x = 0})`,
    `(localVar |= defaultValue) => {}`,
    `if (1) let x = 10;`,
    `function* y({yield}) {}`,
    `let y = () => new.target`,
    `x = { method() 42 }`,
    `x = { get method() 42 }`,
    `x = { set method(val) v = val }`,
    `class A { set prop(x, y) {} }`,
    `[...x in y] = []`,
    `function foo() { 'use strict'; return {yield} }`,
    `function* wrap() { function* foo(a = 1 + (yield)) {} }`,
    `function* wrap() { return (a = 1 + (yield)) => a }`,
    `(function* g() {\nfor (yield '' in {}; ; ) ;\n }`,
    `(function* yield() {})`,
    `function* wrap() {\nfunction* yield() {}\n}`,
    `function* foo(a = yield b) {}`,
    `(class {*foo(a = yield b) {}})`,
    `function* foo(a = class extends (yield b) {}) {}`,
    `function* wrap() {\n(a = yield b) => a\n}`,
    `class B { constructor(a = super()) { return a }}`,
    `({*foo: 1})`,
    `for (let [...foo, bar] in qux);`,
    '(class A extends B { method() { super() } })',
    'for(;;) function a(){}',
    'for(a in b) function c(){}',
    'for(a of b) function c(){}',
    'while(true) function a(){}',
    'with(true) function a(){}',
    'for(let x=1 in [1,2,3]) 0',
    'for(var x=1 of [1,2,3]) 0',
    'for(let x=1 of [1,2,3]) 0',
    'for(; false;) let {}',
    'while(true) let[a] = 0',
    'for ((i in {}));',
    'while(true) let a',
    'while(true) const a',
    'with(true) let a',
    'with(true) class a {}',
    'a: let a',
    `3in[]`,
    `3x0`,
    `\\ua`,
    'continue',
    'break',
    'if (x) continue y',
    `1 + { t:t `,
    `1 + {`,
    `i #= 0`,
    'function a({e: a.b}) {}',
    `\n\n\n{`,
    `{ get 2 }`,
    '{ set 1 }',
    `function t(if) { }`,
    `\u200C = []`,
    `do { x } *`,
    `var`,
    '0B',
    '0B1a',
    '0B9',
    '( { get x() {} } = 0)',
    'x \n is y',
    'for (let x = 42 in list) process(x);',
    'let [this] = [10]',
    'let {this} = x',
    'let [function] = [10]',
    `\\u{FFFF`,
    //`("\\u{}")`,
    `/./a`,
    `enum : 0`,
    `({get +:3})`,
    `if.a;`,
    `a if`,
    `"\\ux";`,
    `0O`,
    `0O1a`,
    `/test`,
    `3 = 4`,
    `var x = "`,
    `({[a,b]:0})`,
    `function t(false) { }`,
    `if(false) doThis(); else`,
    `async function foo(await) { }`,
    `async function foo() { return {await} }`,
    `(async\nfunction foo() { })`,
    `(async function await() { })`,
    `(async function foo(await) { })`,
    `(async function foo() { return {await} })`,
    `[a += b] = []`,
    `({async get foo() { }})`,
    `({async foo() { var await }})`,
    `class A {async get foo() { }}`,
    `class A {async foo() { return {await} }}`,
    // `await a`,
    `async () => await`,
    `async function foo(a = await b) {}`,
    `([a.a]) => 42`,
    `function *g() { (x = yield) => {} }`,
    `( { get x() {} } = 0)`,
    `for (let x = 42 in list) process(x);`,
    `yield v`,
    `let [this] = [10]`,
    `([function] = [10])`,
    `({this} = x)`,
    `var x = {this}`,
    `class A extends yield B { }`,
    `function* foo(a = class extends (yield b) {}) {}`,
    `class A { get constructor() {} }`,
    `(function ({ a(){} }) {})`,
    `class A extends B { constructor() { super } }`,
    `\\u{110000}`,
    `(function () { yield 10 })`,
    `function* f([...{ x }, y] = [1, 2, 3]) {};`,
    `0 = 0;`,
    `[a] *= 0;`,
    `for([0] of 0);`,
    `\\u{FFFFFFF}")`,
    `for(const a = 0, b;;);`,
    `for (var x of []) function* g() {}`,
    `let [...x = []] = [];`,
    ' for(([a]) of 0);',
    ' (function*yield(){})',
    'class A extends a + b {}',
    ' function *g() { var yield; }',
    ' break 1;',
    ' try {} catch (answer()) {} ',
    ' a\\u11z ',
    '"',
    '({a: b = 0, c = 0});',
    ' i #= 42',
    'for(const a = 0 in b);',
    'for (var x = 1 of y);',
    'function*g(){ var yield = 1; }',
    'for (+i in {});',
    ' var a = { set foo(...v) {} };',
    ' let x,',
    '([a,...b,])=>0;',
    '"use strict"; for (let [a = let];;) {}',
    'export *',
    'new X()."s"',
    'function a([a.b]) {}',
    '`hello ${10 `test`',
    ' "\\xx";',
    ' ({a:b[0]})=>0',
    'try {} catch (-x) {} ',
    ' ({ * })',
    '({ set prop() {} })',
    ' function*g() { var yield; }',
    '"use strict" 0123',
    ' var {(a)} = 0',
    '�!',
    '({a:(b = 0)} = 1)',
    ' try { }',
    'function *g() { let yield; }',
    ' 1.e+z',
    ' function f(a, ...b, c){}',
    ' with(true) function a(){}',
    '({set a([a.b]){}})',
    ' var this = 10;',
    ' 1.a',
    ' ({(a):0})',
    '({a:this}=0)',
    '({a:this}=0)',
    '(class extends a,b {})',
    ' [...{a=0},]=0',
    '[...x, ...y] = 0',
    ' for(a in b) function c(){}',
    ' ({ *a: 0 })',
    ' var super',
    ' const x = 0,',
    '(0, {a = 0}) => 0',
    `var x = /[a-z
    ]/\\ux`,
    '"use strict";function foo(){"use strict";}function bar(){var v = 015}',
    ' class A {a(){},b(){}}',
    ' new f(..g);',
    ' for(let a = 0 of b);',
    ' var if = 0',
    ' [a, ...(b = c)] = 0',
    `if (false) ; else const x = null;`,
    `class A { static set prototype() {} }`,
    `function* g(){ ([a = yield]) => 0; }`,
    `for(let a;;) label: function f(){}`,
    'for (;;) const x = 10;',
    `x = { set f(...y) {} }`,
    'if (x) async function f() {}',
    'async function wrapper() {\nasync (a = await b) => {}\n}',
    '({async foo(a = await b) {}})',
    '(class {async foo(a = await b) {}})',
    'async function foo(a = class extends (await b) {}) {}',
    // 'await a',
    'async await => 1',
    'async ([await]) => 1',
    'async a\n=> a',
    'async ()\n=> a',
    '(async function foo() { return {await} })',
    ' /42',
    ' var new A = 0;',
    '({get ',
    '0b1a',
    'yield v',
    ' for (const of 42);',
    ' class ',
    ' ({function} = 0)',
    ' for(let [a, a];;);',
    ' [...x, y] = 0',
    ' (1 + 1) = 10',
    'f = async ((x)) => x',
    '(async function foo() { await })',
    'async () => await',
    '({async foo() { await }})',
    '(class {async foo() { await }})',
    'async function foo(a = await b) {}',
    '(async function foo(a = await b) {})',
    'async (a = await b) => {}',
    `for (let [...foo, bar] in qux);`,
    `();`,
    `for (let x of y, z) {}`,
    `(a, ...b);`,
    `[ a -= 12 ] = 12;`,
    `class A {static static static(){}}`,
    '(class {a})',
    `(function*() {
      function*(x = yield 3) {}
  })`,
    '0O18',
    '"use strict"; `${test}\\02`;',
    '0x3in[]',
    'for (let [a = let];;) {}',
    'var if = 42',
    '\\',
    "'use strict'; 07",
    `(((a, ...b)))`,
    '((a)) => 42',
    '({a.b} = 0)',
    'function *g(yield){}',
    `throw
10;`,
    '({ set prop(x, y) {} })',
    `(((...a)))`,
    `for(const let = 0;;);`,
    `super`,
    `"use strict"; bar: function x() {}`,
    `{ ;  ;  `,
    'var x,',
    'function *g() { let yield; }',
    "('\\u{2028')",
    '"\\u";',
    '({ get prop(x) {} })',
    '"\\u00";',
    'function*g({a: yield}){}',
    'class A;',
    'for (const x = 1 of y);',
    'class;',
    `var x = /[a-z
    ]/\\ux`,
    `a b`,
    `try { } catch() {}`,
    `/*\r\n*/]`,
    `//\r\n]`,
    `\r]`,
    `/*hello`,
    `try {} catch (answer()) {} `,
    `for(;;)`,
    `for (let [] = 0, {};;);`,
    `for (let [];;);`,
    `for (var i, i2 in {});`,
    '([this] = [10])',
    '({this} = x)',
    'var x = {this}',
    `**`,
    `#=`,
    'function* g() { (a = yield) => {} }',
    `\\u{}`,
    '"use strict"; (a) => 00',
    '() <= 42',
    'eq(o) { return this.#x === o.#x; }',
    'class C { ...[] }',
    'for (var [ a ]; a; ) {}',
    'for (var { a, b, c }; a && b && c; ) {}',
    'for (var [x, y] = {} in {});',
    'function foo(...b, a) { return a }',
    '(x, ...y)',
    'with ({}) let [a] = [42];',
    'let {...{}} = {};',
    '(function anonymous()',
    '(10, 20) => 00',
    'void { [1, 2]: 3 };',
    '({ obj:20 }) = 42',
    '[2] = 42',
    '"\\u{FFZ}"',
    `function({b = !b}) { })({})`,
    `function([b = !b]) { })([])`,
    `function(...[b = !b]) { }`,
    '"\\u{FFFF"',
    '([function] = [10])',
    'while(true)break if;',
    'while(true)continue if;',
    'foo:break;',
    'foo++("toString");',
    'async("foo".bar) => x',
    'foo++.toString();',
    'switch(x){ default: foo; break; case x: break; default: fail; }',
    'foo/',
    'if(foo)',
    'for(;;)',
    'for(x in y)',
    'try {} catch(e)',
    'try {} finally',
    'with(x)',
    'label:',
    'foo/ //x',
    'try {} finally//x',
    'try {} catch(e)//x',
    'if(x);else//x',
    'do while();//x',
    'label://x',
    'foo/;',
    'foo*;',
    'for( in y);',
    'for(* in y);',
    'for(x* in y);',
    'for(a?b:x* in y);',
    'for(a?b:* in y);',
    'for(var x=a* in y);',
    'for(var x=u?i:a* in y);',
    'for(*;;);',
    'for(x*;;);',
    'for(a?b:x*;;);',
    'for(a?b:*;;);',
    'for(var x=u?i:a*;;);',
    'for(=x;;);',
    'new',
    'x && new',
    'new\nif(x);',
    'delete;',
    '++',
    '++\n',
    '+\nif(foo);',
    '~\nif(foo);',
    '~\n',
    'var foo, /bar/;',
    'for (var foo, /bar/ in x);',
    'for (a?b:(c in y))z;',
    'for ((c in y))z;',
    '({/foo/:5});',
    '({x:y, /foo/:5});',
    '#',
    '\x00',
    '/foo\nbar/',
    'try{}catch(/foo/){}',
    'try /foo/; catch(e){}',
    'try{}catch(e)/foo/',
    'try{}finally /foo/',
    'function f(/foo/){}',
    'for (var i=0,;;);',
    '1x54',
    'foo;\nbar:',
    'var case = 5;',
    'var continue = 5;',
    'var else = 5;',
    'var for = 5;',
    'var if = 5;',
    'case',
    'super',
    'x(void);',
    'x(break);',
    'x(enum);',
    'x=5+y>>>=8',
    'x=5+y>>=8',
    'x=5+y<<=8',
    'x + b <<= y;',
    'x + b <<= y;',
    'x >>>| y;',
    '5e+',
    '5e*foo',
    "'foo\nbar'",
    "'foo",
    '"foo\nbar"',
    '"foo',
    "'foo\\ubaar",
    "'foo\\xfoo'",
    'x~=y;',
    '/x\ny/',
    '/x[\n]y/',
    '/x\ny/',
    '/foo',
    '/f[oo',
    'for (var debugger in foo);',
    'for (var key on bar);',
    'for (var key ik bar);',
    'for (var key inhere bar);',
    'for (var key instanceof bar);',
    'continue;',
    'try {}',
    '();',
    'foo(());',
    'foo[];',
    'foo?:bar;',
    'var x=;',
    'var x=foo,;',
    'foo,;',
    'super();',
    'true:oops;',
    'false:oops;',
    'null:oops;',
    'this:oops;',
    'do x; y;',
    'x?',
    'x?y:',
    'foo.attr({',
    'foo.attr({x',
    'foo.attr({x:',
    'foo.attr({x:x',
    'var x\n/5',
    'var x=\n/5',
    'var x=5\n/5/',
    'foo++.toString();',
    'a&b=c',
    'a&&b=c',
    'a+b=c',
    'x(a&b=c)',
    'x(a&&b=c)',
    'x(a+b=c)',
    'x %== y',
    'x ==== y',
    'x +== y',
    'x = 5/*',
    'x = 5/* body',
    'x = 5/* body *',
    'switch(x){',
    'switch(x){case x:',
    'switch(x){case x:y;',
    'switch(x){default:',
    '{if(x)}',
    'new void foo',
    'new delete foo',
    'new typeof foo',
    'new ++x',
    'new +x',
    'new --x',
    'new -x',
    'new ~x',
    'new !x',
    'new ++delete x',
    'f(=5);',
    'if x',
    'function(){}',
    'function if(){}',
    'try{} catch(){}',
    'try{} catch(if){}',
    'function foo(if){}',
    'function foo(a, break){}',
    'function foo(a, b, throw){}',
    '({set a(if){}})',
    'while(true)break 5+5;',
    'while(true)continue 5+5;',
    'foo--.toString();',
    'foo++.toString();',
    'typeof: bar;',
    'new x: bar;',
    'x--: bar;',
    'x--: bar;',
    'void x: bar;',
    'do x while(x)y',
    'a\n--',
    'a\n++',
    'default:y',
    'return.x',
    'return=x',
    'return/x',
    '/)',
    '+++=x',
    'x -= += y',
    'delete -= new const5',
    '/foo',
    '/foo(bar)',
    '/(foo)bar',
    '/foo(bar)baz',
    '/foo[bar]',
    '/[foo]bar',
    '/foo[bar]baz',
    '/foo(?:bar)',
    '/(?:foo)bar',
    '/foo(?:bar)baz',
    '/foo(!:bar)',
    '/(!:foo)bar',
    '/foo(!:bar)baz',
    '/foo*',
    '/f+oo',
    '/fo+o',
    '/f.o',
    '/.oo',
    '/fo.',
    '/^foo',
    '/f^oo',
    '/foo^',
    '/foo$',
    '/fo$o',
    '/$foo',
    '/f?oo',
    '/fo?o',
    '/foo?',
    '/fo(?=o)o',
    '/fo(?!a)o',
    '/fo|ao',
    '/fo{2}',
    '/fo{1,2}o?',
    '/fo{1,}',
    '/fo[^a]',
    '/fa[\\b]oo',
    '/(fo)\\b\\B\\cA\\d\\D\\f\\n\\r\\s\\S\\t\\v\\w\\W\\1\\0\\xab\\uabcd',
    '/ab\\1c',
    '/ab\\c',
    '/ab\\c2',
    '/ab\\c\\d',
    '/ab\\z',
    '/ab\\x',
    '/ab\\xa',
    '/ab\\xaz',
    '/ab\\xz',
    '/ab\\u',
    '/ab\\ua',
    '/ab\\ua0',
    '/ab\\ua00',
    '/ab\\uz000',
    '/ab\\uaz',
    '/ab\\ua0z',
    '/a\\/b',
    '/a\\\\b',
    '/a[\\\\]',
    '/a[/',
    '/a[b',
    '/[x]\n/',
    '3in {}',
    `let {[foo]: a + b} = baz`,
    `let {[foo]: bar()} = baz`,
    '5 = 10;',
    'null = 10;',
    'true = 10;',
    'false = 10;',
    'this = 10;',
    '((x,x)) = 5',
    '(((x,x))) = 5',
    '(a=b)=c',
    'new foo = 5',
    'delete foo = 5',
    'void foo = 5',
    '++foo = bar',
    '--foo = bar',
    '+foo = bar',
    '-foo = bar',
    'typeof foo = 5',
    '!foo = 5',
    '~foo = 5',
    'foo-- = 5',
    'foo++ = 5',
    '++x += y',
    '++this;',
    '++null;',
    '++true;',
    '++false;',
    '++function(){};',
    '--this;',
    '--null;',
    '--true;',
    '--false;',
    '--function(){};',
    'this++;',
    'null++;',
    'true++;',
    'false++;',
    '(function(){})++;',
    'this--;',
    'null--;',
    'true--;',
    'false--;',
    '(function(){})--;',
    '(X&&Y)++',
    '(X&&Y)--',
    '(X&Y)++',
    '(X&Y)--',
    '--x++',
    '++x--',
    '--(x)++',
    '++(x)--',
    '(++x)=b',
    '(--x)=b',
    '(x++)=b',
    '(x--)=b',
    '(a=b.c)=d;',
    'a=(a=b.c)=d;',
    'new Date++;',
    'new (A).foo = bar',
    '++++x',
    'async function as(){ class A {async f(yield) {}} }',
    'async function as(){ class A {f(yield) {}} }',
    'function f() { return await foo; }',
    'async function f() { return yield 100; }',
    'o = {*f(x=yield 100) {}}',
    'o = {f(x=yield 100) {}}',
    'class A {*f(x=await foo) {}}',
    'class A {async f(x=await foo) {}}',
    'class A {async f(x=yield 100) {}}',
    'let f = function *f(x=await foo) {}',
    'let f = async function *f(x=yield 100) {}',
    'let f = function f(x=await foo) {}',
    'let f = async function f(x=yield 100) {}',
    'function *f(x=await foo) {}',
    'async function *f(x=await foo) {}',
    'async function f(x=yield 100) {}',
    'function *f(x=yield 100) {}',
    'o = {async f(await) {}}',
    'o = {*f(yield) {}}',
    'o = {async *f(yield) {}}',
    'class A {async f(await) {}}',
    'class A {*f(yield) {}}',
    'let f = async function *f(await) {}',
    'async function as(){ let f = async function *yield() {} }',
    'async function as(){ let f = async function *await() {} }',
    'async function as(){ class A {async f(await) {}} }',
    'async function as(){ o = {*f(yield) {}} }',
    'async function as(){ o = {async f(await) {}} }',
    'async function as(){ async function f(x=yield 100) {} }',
    'async function as(){ function *f(x=yield 100) {} }',
    'async function as(){ async function *f(x=yield 100) {} }',
    'async function as(){ let f = async function *f(yield) {} }',
    'async function as(){ class A {f(yield) {}} }',
    'function f() { return yield 100; }',
    '++--x',
    '+x = y',
    'delete x.y = y',
    "'string'-- &= x;",
    'x()=b',
    '(x())=b',
    '({a:b}[ohi].iets()++);',
    '++foo()',
    '--foo()',
    '.5e05\n<<\ntypeofthrow(\n)++',
    '.5e05\n<<\ntypeofthrow(\n)--',
    '(x())=b',
    '++foo()',
    '--foo()',
    '.5+/=>>>=ex/bar/g--;',
    'var new A = 0;',
    '/42',
    'function null() { }',
    'function x(...a = 1){}',
    'function *g() { function yield() {} }',
    '0b1a',
    '[...x,,] = 0',
    'new.prop',
    'yield v',
    'for (const of 42);',
    '({a,,} = 0)',
    '\\001 "use strict";',
    '({function} = 0)',
    '1 + { t:t,',
    '0B9',
    '() + 0',
    'for (const x = 0 in y){}',
    '() ? 42',
    '(function*yield(){})',
    '0B12',
    'function* f() { [yield {a = 0}]; }',
    'function t(if) { }',
    '({ *[yield iter]() {} })',
    '(a,b)=(c,d);',
    'var [a.b] = 0',
    'try {} catch (answer()) {}',
    'i + 2 = 42',
    'try {} catch (42) {} ',
    'try {} catch (a, b) {} ',
    'try {} catch (a = b) {} ',
    'function a(1) {}',
    'for (const let = 1;;;) {}',
    '({ 5 }) => {}',
    'with(true) let a',
    'x\\',
    'a: let a',
    'function*g(){ function yield(){}; }',
    '([ 5 ]) => {}',
    '{',
    'function* f() { [yield* {a = 0}]; }',
    '({ get test() { } }) => 42',
    '{ ;  ;  ',
    'void { [1, 2]: 3 };',
    'function *g() { function *yield(){} }',
    '({a = 0}, {a = 0}, 0) => 0',
    'function f(a, ...b, c){}',
    'with(true) function a(){}',
    'class A;',
    'var x = /[a-z]/\\ux',
    'class A extends yield B { }',
    '({set a([a.b]){}})',
    'for(let of 0);',
    'class default',
    'function t() { ;  ;  ',
    '({get a(){}}) => 0;',
    '({"a"} = 0)',
    '((a),...a) => 1',
    'class A {a(){},b(){}}',
    '(function*() {  function*({x: y = yield 3}) {} })',
    '/*hello',
    '"',
    '({(a):0})',
    '"use strict"; ({ v: arguments }) = obj',
    '({ get: g(d) { } })',
    'f(....a)',
    'try {} catch ((e)) {}',
    '[...a, ] = b',
    'let [...a,] = 0',
    'class A { set prop(x, y) {} }',
    '(a ...b) => 0',
    '(...a, ...b) => 0',
    '({a: 0, b = 0});',
    'a class;',
    '({a: b += 0} = {})',

    'a if;',
    '(function* ([a.b]) {})',
    '"use strict"; for (let {a: b = let};;) {}',
    '\\uD800\\uDC00',
    '({ set: s(a, b) { } })',
    '() <= 0',
    'var {a};',
    '({a:for} = 0)',
    '({a: b += 0} = {})',
    '({a: b += 0} = {})',
    '({a: b += 0} = {})',
    '({a: b += 0} = {})',
    '({a: b += 0} = {})',
    '({a: b += 0} = {})',
    '({a: b += 0} = {})',

    'class Foo { * }',
    '[0] = 0',
    '( { get x() {} } ) = 0',
    '1 + (',
    '(...a, b) => {}',
    '"\\x";',
    '(...[ 5 ]) => {}',
    'a\\u111z',
    '(function*({yield}) {})',
    'x = { set method(val) v = val }',
    'switch (c) { default: default: }',
    '++1',
    'function t(...) { }',
    '--1',
    '(...)',
    '(...abc,)',
    '(...a=b=c)',
    '(...abc,)',
    '(...abc=,)',
    '(...abc,=)',
    '(...abc,,,,,,,=)',
    '(...abc,,,,,,,=====)',
    '(...a=b=c)',
    '(...abc,)',
    '(...)',
    '(...abc,) => {}',
    '(...a=b=c) => {}',
    '(...abc,) => {}',
    'async (...) => {}',
    'async (...abc,) => {}',
    'async (...a=b=c) => {}',
    'async (...abc,) => {}',
    'function t() {',
    '({ 42 }) = obj',
    '({(a)} = 0)',
    '(10, 20) => 00',
    '({e: a.b}) => 0',
    'a++``',
    '() + 42',
    'for (var i, i2 in {});',
    'while (1) function foo(){}',
    'for(let.a of 0);',
    '(class {[a,b](){}})',
    'function t(false) { }',
    '(function*() { function(x = yield 3) {} })',
    "'",
    '({,a,} = 0)',
    'var obj = { *test** }',
    '/*hello  *',
    'for(let a = 0 in b);',
    'class extends A{}',
    '({a,,a} = 0)',
    '({ set: s(a, b) { } })',
    '({ set s() { } })',
    'try { throw []; } catch ([...x = []]) {}',
    'f = function*([...{ x }, y]) {}',
    'f = ([...x = []]) => {}',
    'f = async function*({ x, ...{y , z} } = o) {}',
    'f = async function*({a, b, ...{c, ...rest}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {}',
    'let async function() { } = { };',
    'function f(async function() {}) { }',
    'f = async function*({a, b, ...{c, e}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {}',
    '[, x, ...y,] = 0',
    '}',
    '() => { class a extends b { static get prototype(){} } }',
    'try { throw [1, 2, 3]; } catch ([...{ x }, y]) {}',
    'class a extends b { static set prototype(){} }',
    '(class { *static x() {} })',
    'class A { *constructor() {} }',
    '(class A extends B { constructor() { function f() { super() } } })',
    'var a = { set foo(...v) {} };',
    'var super',
    '() <= 42',
    'for ({ x: [(x, y)] } in [{ x: [] }]) ;',
    'for ({ x: { get x() {} } } in [{ x: {} }]) ;',
    'let {this} = x',
    'let [function] = [10]',
    'let [function] = x',
    '([function] = [10])',
    '([this] = [10])',
    '({this} = x)',
    'var x = {this}',
    '(function () { yield 10 })',
    'const let',
    '(function() { "use strict"; f(yield v) })',
    'var obj = { *test** }',
    'class A extends yield B { }',
    'class default',
    'class let {}',
    '`test',
    'switch `test`',
    'function a() 1 // expression closure is not supported',
    '[...a, ] = b',
    'x = { method() 42 }',
    'x = { set method(val) v = val }',
    '(function* g() {\nfor (yield "" in {}; ; ) ;\n }',
    'delete o.p ** 2;',
    '~3 ** 2;',
    '+2** 2;',
    'let {...{...{x, y}}} = {}',
    '0, {...rest, b} = {}',
    'for (true ? cond2() : "" in cond1(); false; ) ;',
    'function* g() { (yield) = 1; }',
    'function*g() { var yield; }',
    '(class {[3]:0})',
    '(function ({e: a.b}) {})',
    'async function f(){    (fail = class A extends await foo {}) => fail    }',
    'foo: class X {}',
    '() => { super(); }',
    'super',
    '0, { get a(param = null) {} };',
    '(async function*(x = await 1) { });',
    '({[foo]: bar()} = baz)',
    '({[foo]: a + b} = baz)',
    '({[foo]: bar()}) => baz',
    '({[foo]: a + b}) => baz',
    'let {[foo]: bar()} = baz',
    '({ident: [foo, bar]/x}) => x',
    '({ident: [foo, bar] += x})',
    '({x: const}) => null',
    'for (let {[x]};;);',
    'for (let {a:=c} = z);',
    'for (let {[x]} = z);',
    'for (let {a:=c} of z);',
    'for (var {[x]};;);',
    'for (var {[x]} = z);',
    'for (var {a:=c} of z);',
    '...x => x',
    'y, ...x => x',
    'z={x:b\n++c};',
    '[...{a = b} = c] = d;',
    '([x, y]) = z;',
    '(x--, y) => x;',
    '++new x()',
    'new typeof x.y',
    'f = ([...[ x ] = []]) => {};',
    '({get a(){}})=0',
    'a enum;',
    'function f([... ...foo] = obj){}',
    ' function f([...] = obj){}',
    'function f([...foo,]){}',
    'function f([...foo,,]){}',
    'function f([...[a, b],,] = obj){}',
    'function f([...[a, b],]){}',
    'function f([... ...foo] = obj){}',
    '[[[[[[[[[[[[[[[[[[[[{a=b}]]]]]]]]]]]]]]]]]]]]',
    'yield x + y',
    '[...0,a]=0',
    'for (x=0 of y);',
    'for (x=0 in y);',
    'function f([...]){}',
    'function f([... ...foo]){}',
    'function f([... ...foo] = obj){}',
    'function f(){ 5 + yield x + y; }',
    `function* g() { yield 3 + yield 4; }`,
    'function*g({yield}){}',
    '({[a,b]:0})',
    'try { }',
    '[,',
    '([a.b]) => 0',
    'function f4([{[foo]}]) {}',
    'for (var _a = void 0, a = _a[0], b = _a[1] in []) { }',
    'var { while } = { while: 1 }',
    'var { "while": while } = { while: 1 }',
    '(function() { var s0; for ({ s0 = 5 } of [{ s0: 1 }]) { function foo({a = 4, b = { x: 5 }}) {}',
    '(0, {a = 0}) = 0',
    'var {(a)} = 0',
    '({a:(b = 0)} = 1)',
    'for (;b\n++c);',
    'yield x + y',
    'a b;',
    `do {  test262: {  continue test262; } } while (a)`,
    "('\\x0')",
    '({a: b += 0} = {})',
    '[...{a = b} = c] = x',
    '([...{a = b} = c]) => d',
    'for (const x of []) label1: label2: function f() {}',
    '0xz',
    'function f1([a], {b}, c, d) { // error',
    'var [a], {b}, c, d; // error',
    'function a({while}) { }',
    '([[[[[[[[[[[[[[[[[[[[{a:b[0]}]]]]]]]]]]]]]]]]]]]])=>0;',
    `({x}) = {x: 1};`,
    '3ea',
    'var v = (a, b) = c',
    'if (x) {}}dsadsa',
    'for (;;) {}}dsadsa',
    `function f() { for (new.target = 0 in {}); }`,
    `class C extends D { constructor() { for (super() = 0 in {}); } }`,
    'var x = `abc${ yield 10 }def`;',
    'async function fn() { for await (var x = 1 of []) {} }',
    'async function fn() { for await (var {x} = 1 of []) {} }',
    '(function* a(b,,) {});',
    'a(1,2,3,,);',
    'a1(,);',
    '(function*  (b, c, ...d,) {});',
    '(function   (b, c, ...d,) {});',
    ' function* a(b, c, ...d,) {}',
    '(function* a(...b,) {});',
    '(a,b,c,);',
    'while (;;) function * f() {}',
    'do const y = x; while (x);',
    'function*g({yield}){}',
    '[+{a = 0}];',
    'try {} catch (answer()) {} ',
    '/(?:)/esprima_reg_exp_should_disallow_this',
    'let let = 1;',
    'const let = 1;',
    'class public {}',
    '++x = y',
    '++x => b',
    '++x = y',
    'let y = typeof async x => await x',
    '++x => b',
    '++(x) => b',
    `(x) = (1) = z`,
    `(x) = (1) += z`,
    `(x) += (1) = z`,
    'const ([a] = b) = c;',
    `[(a = x)] = x`,
    `[...{a: function=x} = c]`,
    `({foo = 10})`,
    'class x extends ()=>{} {}',
    'class x extends ()=>1 {}',
    `async (x = (await) = f) => {}`,
    `async (x = (x) = await f) => {}`,
    `async (x = (x) += await f) => {}`,
    'await ()=>x',
    `new await x()`,
    `new b++c;`,
    `5+yield x`,
    `function *f(){ return 5 + yield x; }`,
    `new await x()()`,
    `delete foo=>bar`,
    `new foo=>bar`,
    `await foo=>bar`,
    `()=>{}.foo`,
    `()=>{}[foo]`,
    `()=>{}(foo)`,
    '()=>{}`foo`',
    `()=>{}++`,
    `()=>{}--`,
    `function *f(){ ~yield }`,
    `class x extends ()=>{} {}`,
    `class x extends ()=>{} 1`,
    `for (b++c;;);`,
    `function *f{ (x = x + yield); }`,
    '(x)\n++;',
    '(((x)))\n++;',
    'if (a) a\n++;',
    'let x = () => a\n++;',
    'x.foo++.bar',
    '(x)\n--;',
    'if (a) a\n--;',
    'if (a\n--);',
    'function f(){ return a\n--; }',
    'function f(foo = +await bar){}',
    'async function f(foo = +await bar){}',
    'class x {async *f(foo = [{m: t(await bar)}]){}}',
    'function f(foo = [{m: t(+await bar)}]){}',
    'async function f(foo = [{m: t(+await bar)}]){}',
    // 'async ([x] = await bar);',
    'function *a({yield}){}',
    'function *a({yield = 0}){}',
    '(foo = +await bar) => {}',
    'async (foo = +await bar) => {}',
    '(foo = [{m: 5 + t(+await bar)}]) => {}',
    'async (foo = [{m: 5 + t(+await bar)}]) => {}',
    'async function g(){ function f(foo = +await bar){}    }',
    'async function g(){async function f(foo = +await bar){}    }',
    'async function g(){ function f(foo = [h, {m: t(+await bar)}]){}    }',
    'async function g(){async function f(foo = [h, {m: t(+await bar)}]){}    }',
    'async function a(){ (foo = +await bar) => {}     }',
    'async function a(){ async (foo = +await bar) => {}     }',
    'async function a(){ (foo = [{m: 5 + t(+await bar)}]) => {}     }',
    'async function a(){ async (foo = [{m: 5 + t(+await bar)}]) => {}     }',
    '++(x) => b'
  ]) {
    it(`${arg}`, () => {
      t.throws(() => {
        parseSource(`${arg}`, undefined, Context.OptionsWebCompat);
      });
    });
    it(`${arg}`, () => {
      t.throws(() => {
        parseSource(`${arg}`, undefined, Context.None);
      });
    });
    it(`${arg}`, () => {
      t.throws(() => {
        parseSource(`${arg}`, undefined, Context.OptionsLexical);
      });
    });
    it(`${arg}`, () => {
      t.throws(() => {
        parseSource(`${arg}`, undefined, Context.OptionsLexical | Context.Strict | Context.Module);
      });
    });
    it(`${arg}`, () => {
      t.throws(() => {
        parseSource(`${arg}`, undefined, Context.Strict | Context.Module);
      });
    });
  }
});
